package com.rm.zeyou.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.rm.zeyou.entity.User;
import com.rm.zeyou.response.ApiRestResponse;
import com.rm.zeyou.service.SalesmanApplyService;
import com.rm.zeyou.util.login.LoginUtil;
import com.rm.zeyou.vo.request.ApplySalesmanVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 业务员申请表 前端控制器
 * </p>
 *
 * @author YanYang
 * @since 2025-03-22 14:47:24
 */
@Api(tags = "业务员申请相关")
@RestController
@RequestMapping("/api/salesmanApply")
public class SalesmanApplyController {
    @Resource
    private SalesmanApplyService salesmanApplyService;
    @Resource
    private LoginUtil loginUtil;

    @ApiOperation(value = "申请业务员")
    @PostMapping("applySalesman")
    @SaCheckLogin(type = "user")
    public ApiRestResponse<Integer> applySalesman(@RequestBody ApplySalesmanVo applyVo) {
        User user = loginUtil.getUser();
        return salesmanApplyService.applySalesman(user,applyVo);
    }


}
